package com.yanqu.road.logic.bussiness.activity;

import com.yanqu.road.entity.activity.dragonboatrace.*;
import com.yanqu.road.entity.activity.dragonboatrace.config.DragonBoatRacePlaceConfig;
import com.yanqu.road.entity.activity.dragonboatrace.config.DragonBoatRaceSpeedConfig;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author cwq
 * @Data 2021/5/14 16:06
 */
public class DragonBoatRaceBusiness {

    // DragonBoatRaceUserData
    public static DragonBoatRaceUserData getDragonBoatRaceUserData(long userId, int activityId) {
        return DaoHelper.getDragonBoatRaceUserDataDaoImpl().getData(activityId, userId);
    }

    public static boolean addDragonBoatRaceUserData(DragonBoatRaceUserData dragonBoatRaceUserData) {
        return DaoHelper.getDragonBoatRaceUserDataDaoImpl().add(dragonBoatRaceUserData);
    }

    public static boolean updateDragonBoatRaceUserData(DragonBoatRaceUserData dragonBoatRaceUserData) {
        return DaoHelper.getDragonBoatRaceUserDataDaoImpl().update(dragonBoatRaceUserData);
    }


    // DragonBoatRaceUnionData
    public static Map<String,DragonBoatRaceUnionData> getDragonBoatRaceUnionDataMap(int activityId) {
        return DaoHelper.getDragonBoatRaceUnionDataDaoImpl().getDragonBoatRaceUnionDataMap(activityId);
    }

    public static boolean addDragonBoatRaceUnionData(DragonBoatRaceUnionData dragonBoatRaceUnionData) {
        return DaoHelper.getDragonBoatRaceUnionDataDaoImpl().add(dragonBoatRaceUnionData);
    }

    public static boolean updateDragonBoatRaceUnionData(DragonBoatRaceUnionData dragonBoatRaceUnionData) {
        return DaoHelper.getDragonBoatRaceUnionDataDaoImpl().update(dragonBoatRaceUnionData);
    }

    // Config
    public static List<DragonBoatRacePlaceConfig> getDragonBoatRacePlaceConfigList(int activityId) {
        return DaoHelper.getDragonBoatRaceConfigDaoImpl().getDragonBoatRacePlaceConfigList(activityId);
    }

    public static List<DragonBoatRaceSpeedConfig> getDragonBoatRaceSpeedConfigList(int activityId) {
        return DaoHelper.getDragonBoatRaceConfigDaoImpl().getDragonBoatRaceSpeedConfigList(activityId);
    }

}
